package com.jfcloud.common.http;


public class RespDataT<T>{
	public static final int Success = 1;
	public static final int Error = 0;
	
	private int status;
	private T datas ;
	private Object meta = "";
	
	@SuppressWarnings("unchecked")
	public RespDataT(T datas) {
		this.datas = datas;
		this.status =Success;
	}
	
	
	@SuppressWarnings("unchecked")
	public RespDataT(int status, T datas) {
		this.status = status;
		if(status == Success){
			this.datas = datas;
		}else{
			this.meta = datas;
		}
	}
	
	
	
	public RespDataT(Exception e){
		this.status = Error;
		this.meta = e.getMessage();
		
		if(this.meta==null || "".equals(this.meta)) {
			this.meta="系统内部错误";
		}
	}

	public RespDataT() {
	}
	
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public T getDatas() {
		return datas;
	}
	public  void  setDatas(T datas) {
		this.datas = datas;
	}
	public Object getMeta() {
		return meta;
	}
	public void setMeta(Object meta) {
		this.meta = meta;
	}
	
	
	
}
